Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix incompatability with scarpet explosion event #565

Merged
merged 1 commit into from
Sep 13, 2024

Conversation

wendavid552
Copy link
Contributor

@wendavid552 wendavid552 commented Sep 13, 2024

Since gnembon/fabric-carpet#1937 didn't get merged for a while, here is a tricy ways of fixing the incompatability in lithium's side.

Just simply replace the @Redirect into @WrapOperation, and the original.call() would contain the @Redirect from fabric-carpet. Therefore the getExplosure() firstly goes to our wrapping, then scarpet would detect the explosion event. But if it is a duplucated explosure we would skip it, and actually from the design of scarpet it is useless to detect the explosion again (as they are the same one, just mentioned again).

Tested in 1.21 with fabric-carpet, the wrapping works and the explosion event is triggered too.

@2No2Name 2No2Name merged commit f4705b2 into CaffeineMC:develop Sep 13, 2024
@2No2Name
Copy link
Member

Thank you for this contribution. I am a bit concerned about the performance impact of @WrapOperation but many users suggested that the compiler should be able to eliminate it. Performance testing will be done in the future. Contributions are also welcome

2No2Name pushed a commit that referenced this pull request Sep 20, 2024
)

Use `@WrapOperation` instead of `@Redirect` to avoid the mixin incompatibility
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants